package com.lyp.crm.conrtoller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.lyp.crm.entity.Fenye;
import com.lyp.crm.entity.Qiandao;
import com.lyp.crm.service.Qiandaodao;

import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@Controller
@CrossOrigin(origins = "*")
public class QiandaoContrller {
	@Autowired
	private Qiandaodao qiandaodao;
	@Autowired
	private Fenye<Qiandao> fenye;
	
	
	@ApiOperation(value="多条件查询签到信息", notes="根据 url 的各种数据来获取签到的详细信息")
	@ApiImplicitParams({
		@ApiImplicitParam(name = "page", value = "分页参数", required = true, dataType = "Integer", paramType = "path"), 
		@ApiImplicitParam(name = "rows", value = "分页参数", required = true, dataType = "Integer", paramType = "path"), 
		@ApiImplicitParam(name = "quid", value = "员工id", required = true, dataType = "Integer", paramType = "path"), 
		@ApiImplicitParam(name = "quname", value = "员工姓名", required = true, dataType = "String", paramType = "path"), 
		@ApiImplicitParam(name = "qtimedate", value = "签到时间", required = true, dataType = "String", paramType = "path"), 
		@ApiImplicitParam(name = "qstatus", value = "签到状态", required = true, dataType = "Integer", paramType = "path"), 
		
	})
	@ResponseBody
	@RequestMapping(value="/SelectQiandao",method=RequestMethod.POST)
	public Fenye<Qiandao> SelectQiandao(Qiandao qiandao,Integer page,Integer rows) {
		fenye.setPage((page-1)*rows);
		fenye.setPageSize(rows);
		fenye.setT(qiandao);
		fenye = qiandaodao.SelectQiandao(fenye);
		return fenye;
	}
	@ApiOperation(value="修改签到信息", notes="根据 url 的数据来修改签到的详细信息")
	@ApiImplicitParams({
		@ApiImplicitParam(name = "uid", value = "员工id", required = true, dataType = "Integer", paramType = "path"), 
		@ApiImplicitParam(name = "sui", value = "学生id", required = true, dataType = "Integer", paramType = "path"),  
		
	})
	@ResponseBody
	@RequestMapping(value="/updateQiandao",method=RequestMethod.POST)
	public Integer updateQiandao(Integer uid,Integer sui) {
		
		return qiandaodao.updateQiandao(uid, sui);
	}
	
	
	
}
